// 控制器公共方法
package common

import (
	"xue/web/app/controller/demo"
	"xue/web/app/controller/sys"

	"github.com/gin-gonic/gin"
)

var (
	//...符号指定的长度等于文字中元素的数量
	controllers = [...]IController{
		new(demo.Demo1Controller),
		new(demo.Demo2Controller),
		new(sys.UserController),
	}
)

type IController interface {
	Register(gin.IRouter)
}

// Register 统一将系统中所有的控制器注册到路由中
func Register(r *gin.Engine) {
	//分组的路由器
	// restGroup := r.Group("/restful")
	for _, v := range controllers {
		v.Register(r)
	}
}
